package com.fallsvc.onlinemusic.mapper;

import com.fallsvc.onlinemusic.model.LoveMusic;
import com.fallsvc.onlinemusic.model.Music;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @auther falls_vc
 * description:
 * @date 2025/4/9  20:30
 */

@Mapper
public interface LoveMusicMapper {
    /**
     * 查询喜欢音乐
     * @param loveMusic
     * @return
     */

    LoveMusic findLoveMusicByUserIdAndMusicId(LoveMusic loveMusic);

    /**
     * 收藏音乐
     * @param loveMusic
     * @return
     */
    boolean insertLoveMusic(LoveMusic loveMusic);

    /**
     * 删除收藏音乐
     * @param loveMusic
     * @return
     */
    boolean deleteByUserIdAndMusicId(LoveMusic loveMusic);

    /**
     * 通过userId查找收藏音乐
     * @param userId
     * @return
     */
    List<Music> findLoveMusicByUserId(Integer userId);

    /**
     * 通过音乐名字和用户id查找收藏音乐
     * @param musicName
     * @param userId
     * @return
     */
    List<Music> findLoveMusicByKeyAndUserId(String musicName,Integer userId);

    /**
     * 通过音乐id删除收藏音乐
     * @param musicId
     * @return
     */
    Integer deleteByMusicId(Integer musicId);
}
